{include file="public/header"}
	<style>
		table{
			width: 100%;
			border: 1px solid red;
		}
		th,td{
			border: 1px solid red;
			padding: 5px 0;
		}
	</style>
</head>
<body>
	<header>
		<div>
			<a href="javascript:history.back();"><i class="icon-fanhui icon iconfont"></i></a>
		</div>
		<div>
			商品详情
		</div>
		<div></div>
	</header>
	<div class="main">
		<div class="swiper-container cpshow">
		  <div class="swiper-wrapper">
		  	{foreach $photo_string as $v}
		    <div class="swiper-slide">
		    	<img src="/static/{$v}" alt="">
		    </div>
			{/foreach}
		  </div>
		  <div class="swiper-pagination"></div>
		</div>
		<div class="cpDetail">
			<h1 class="title">
				<i class="icon-gouwudai icon iconfont"></i>
				<span>{$name}</span>
			</h1>
			<div class="price">
				<ins class="xj">￥<em>{$price_shop}</em></ins>
				<del class="yj">￥<em>{$price}</em></del>
			</div>
			<div class="twd">
				<h2><i class="icon-icon-tuwen icon iconfont"></i>属性列表</h2>
				<table>
					{foreach $attr as $v}
					<tr>
						<th>{$v['attr_name']}</th>
						<th>{$v['attr_value']}</th>
					</tr>
					{/foreach}
				</table>				
			</div>
			<div class="twd">
				<h2><i class="icon-icon-tuwen icon iconfont"></i>图文详情</h2>
				<div class="content">
					{$content}
				</div>
			</div>
		</div>
	</div>
	<script> 
		var mySwiper = new Swiper('.swiper-container', {
			autoplay: 5000,//可选选项，自动滑动
			loop:true,
			pagination : '.swiper-pagination',
			paginationType:"fraction"
		})
	</script>
	<div class="dz">
		<a href="#" id="gid"  gid="{$id}">立即抢购</a>
	</div>
	<script type="text/javascript">
        $('#gid').click(function () {
            var gid=$(this).attr("gid");
            $.ajax({
                type: 'post',
                url: '{:url("Good/ajaxCart")}',
                data: {gid:gid},
                dataType: 'json',
                success: function (data) {
                    if (data !== false){
                        alert('添加成功');
                    }else {
                        alert('添加失败');
                    }
                }
            })
        })
	</script>
</body>
</html>